import React from "react"
// import { connect } from "react-redux";
import { useDispatch, useSelector, useBoundDispatch } from './redux/react-redux';
import actionCounter from "./store/actions/counter";
import actionNumber from "./store/actions/number";

function AppFunc() {
    const state = useSelector((state) => state)
    const dispatch = useDispatch()
    let boundActions = useBoundDispatch(actionNumber);
    return (
      <>
          <div>{state.counter.counter}</div>
            <button onClick={() => dispatch(actionCounter.add1())}>+</button>
            <button onClick={() => dispatch(actionCounter.minus1())}>-</button>

            <div>{state.number.number}</div>
            <button onClick={() => boundActions.add2()}>+</button>
            <button onClick={() => boundActions.minus2()}>-</button>
      </>
    )
}
export default AppFunc